package com.zcup.designer.behavior.state;

public class Context {
    private State state;

    public Context(State state) {
        this.state = state;
    }

    public State getState() {
        return state;
    }

    public void setState(State state) {
        System.out.printf("now state is changing from %s to %s\n",this.state.getClass().getName(), state.getClass().getName());
        this.state = state;
    }
    public void request(){
        state.handle(this);
    }
}
